package com.ushio.gougouwangguo.controller;

import com.ushio.commonmodule.pojo.result.Result;
import com.ushio.gougouwangguo.entity.vo.OccupationTypeListVo;
import com.ushio.gougouwangguo.service.impl.OccupationTypeServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("occupation")
public class OccupationTypeController {


    @Autowired
    OccupationTypeServiceImpl occupationTypeService;

    @GetMapping
    public Result<List<OccupationTypeListVo>> getOccupationTypeListVo(){
        try{
           List<OccupationTypeListVo> listVoList = occupationTypeService.getOccupationTypeListVo();
            return Result.success(listVoList);
        }catch (Exception e){
            e.printStackTrace();
            return Result.fail(e.getMessage());
        }
    }

}
